#!/usr/bin/perl -w
#Copyright (c) 2013 The cwkshell Authors. All rights reserved. 
# Use of this source code is governed by a BSD-style license that can be 
#found in the LICENSE file. 
use Cwd;

open SVN_LIST ,getcwd.'/src/third_party/third_part_svn_url_lists' or die 'Can not open files ';
$third_party_dir =  getcwd. "/src/third_party/";
while(<SVN_LIST>){
	chomp;
	if(/(?<name>.*) =(?<url>.*)/){
		
		$name = $+{name};
		
		$url = $+{url};
		$dir = $third_party_dir.$name;
		if(-e $dir){
			system('svn  update '.$dir );
		}
		else{
			print "checkout $+{name}:\n";
			system('svn checkout '.$url.'   '.$dir);
		}
	}
	
}
close SVN_LIST;